package net.cheyo.weibo;

import org.apache.log4j.Logger;

import weibo4j.Oauth;
import weibo4j.model.WeiboException;

import com.opensymphony.xwork2.ActionSupport;

public class WeiboLoginAction extends ActionSupport
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String SinaWeiboLoginUrl;

    public static Logger logger = Logger.getLogger(WeiboLoginAction.class);

    public String execute()
    {
        Oauth oauth = new Oauth();
        try
        {
            SinaWeiboLoginUrl = oauth.authorize("code", "a123456");
        }
        catch (WeiboException e)
        {
            logger.error(e);
        }

        return "SinaPage";
    }

    public String getSinaWeiboLoginUrl()
    {
        return SinaWeiboLoginUrl;
    }

    public void setSinaWeiboLoginUrl(String sinaWeiboLoginUrl)
    {
        SinaWeiboLoginUrl = sinaWeiboLoginUrl;
    }

}
